package com.wang;

import com.wang.config.Myconfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author :  DongZheng Wang
 * @PROJECT_NAME: springbootTest
 * @date :  2022-10-27 17:59
 **/
@SpringBootApplication
public class My {
    public static void main(String[] args) {
        //得到改类的反射类，然后进行运行加载该反射类
        ConfigurableApplicationContext run = SpringApplication.run(My.class, args);
//        String[] n = run.getBeanDefinitionNames();
//        for (String s : n) {
//            System.out.println(s);
//        }
//        Myconfig bean = run.getBean(Myconfig.class);
//        bean.myBean();
//        boolean myBean = run.containsBean("myBean");
//        System.out.println("myBean: " + myBean);
        boolean user = run.containsBean("user");
        System.out.println("user: " + user);
    }
}
